package juc.volatileDemo;

/**
 * @author liuchaoqun
 * @date 2022/8/26
 * @Description
 */
public class Main {

    public static void main(String[] args) {
        VolatileResource volatileResource = new VolatileResource();
        new Thread(volatileResource).start();
        while (true) {
            if (volatileResource.getTag()) {
                System.out.println("监测true");
                break;
            }
        }
    }
}
